home *** CD-ROM | disk | FTP | other *** search
/ BCI NET 2 / BCI NET 2.iso / archives / programming / languages / obrn-a_1.5_lib.lha / oberon-a / source2.lha / Source / AmigaUtil / ASLUtil.mod < prev    next >
Encoding:
Text File  |  1995-01-26  |  1.5 KB  |  62 lines

  1. (*************************************************************************
  2.  
  3.      $RCSfile: ASLUtil.mod $
  4.   Description: Support for clients of asl.library
  5.  
  6.    Created by: fjc (Frank Copeland)
  7.     $Revision: 3.7 $
  8.       $Author: fjc $
  9.         $Date: 1995/01/26 00:30:04 $
  10.  
  11.   Copyright © 1994, Frank Copeland.
  12.   This file is part of the Oberon-A Library.
  13.   See Oberon-A.doc for conditions of use and distribution.
  14.  
  15. *************************************************************************)
  16.  
  17. <* STANDARD- *> <* INITIALISE- *> <* MAIN- *>
  18. <*$ CaseChk-  IndexChk- LongVars+ NilChk-  *>
  19. <*$ RangeChk- StackChk- TypeChk-  OvflChk- *>
  20.  
  21. MODULE ASLUtil;
  22.  
  23. IMPORT SYS := SYSTEM, u := Utility, i := Intuition, ASL;
  24.  
  25. (*------------------------------------*)
  26. (*
  27.   Simple wrapper for calling the ASL FileRequester.
  28. *)
  29.  
  30. PROCEDURE RequestFile * (
  31.   window        : i.WindowPtr;
  32.   hail          : ARRAY OF CHAR;
  33.   VAR file      : ARRAY OF CHAR;
  34.   VAR directory : ARRAY OF CHAR )
  35. : BOOLEAN;
  36.  
  37.   VAR
  38.     fr : ASL.FileRequesterPtr; result : BOOLEAN;
  39.  
  40. <*$CopyArrays-*>
  41. BEGIN (* RequestFile *)
  42.   fr := SYS.VAL (ASL.FileRequesterPtr,
  43.     ASL.AllocAslRequestTags
  44.       ( ASL.fileRequest,
  45.         ASL.hail,   SYS.ADR (hail),
  46.         ASL.window, window,
  47.         ASL.file,   SYS.ADR (file),
  48.         ASL.dir,    SYS.ADR (directory),
  49.         u.end ));
  50.   IF fr # NIL THEN
  51.     result := ASL.AslRequestTags (fr, u.end);
  52.     IF result THEN COPY (fr.drawer^, directory); COPY (fr.file^, file) END;
  53.     ASL.FreeAslRequest (fr)
  54.   ELSE
  55.     result := FALSE
  56.   END;
  57.   RETURN result
  58. END RequestFile;
  59.  
  60. END ASLUtil.
  61.  
  62.